package com.example.haojiutao.context;



/**
 * @Description: 通过LocalThread获取当前登录的ID
 * @Author: cheng_jianzhen
 * @CreateTime: 2024/2/4 10:20
 */


public class LoginContext {
    public static ThreadLocal<Integer> threadLocal=new ThreadLocal<>();
    public static void setCurrentId(Integer id){
        threadLocal.set(id);
    }
    public static Integer getCurrentId(){
        return threadLocal.get();
    }
    public static void removeCurrentId(Long id){
        threadLocal.remove();
    }
}
